#ifndef _H_SAFEMETHODS__
#define _H_SAFEMETHODS__

#include<memory.h>

template<class T>
struct sAutoZero : public T
{
	sAutoZero()
	{
		memset(this, 0, sizeof(T));
		dwSize = sizeof(T);
	}
};

template<class T>
inline void SafeRelease(T& iface)
{
	if(iface)
	{
		iface->Release();
		iface = NULL;
	}
}
#endif